import { GameActionQueueEnum, GameManager } from "../../scripts/GameManager";
import { PalBattleSkillOriginData, PalBattleSystem } from "../../scripts/PalBattleSystem";
import { SkillEnum } from "./SkillEnum";

export const skill_001_气疗术: PalBattleSkillOriginData = {
    skillID: SkillEnum.气疗术,
    name: '气疗术',
    mpCost: 10,
    order: () => 10,
    needTarget: true,
    targets: (args: { system: PalBattleSystem }) =>
        args.system.heros.filter((hero) => !hero.saveData.dead).map((hero) => hero.saveData.UUID),
    callable: (args: { game: GameManager; system: PalBattleSystem; targets: string[] }) => {
        const system = args.system;
        system.actionQueue.add({
            actions: [
                {
                    action: GameActionQueueEnum.HeroAnime,
                    duration: 1,
                    args: {
                        UUID: args.targets[0],
                        name: 'heal',
                    }
                },
                {
                    action: GameActionQueueEnum.SetHeroStatus,
                    duration: 0,
                    args: {
                        UUID: args.targets[0],
                        status: 'hp',
                        value: system.getHealHero(args.targets[0], 50),
                    }
                },
            ],
            flag: ''
        });
    }
}


